package com.faf.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.faf.bean.Detail;
import com.faf.bean.Orders;
import com.faf.dao.DetailDao;
import com.faf.dao.impl.DetailDaoImpl;
import com.faf.service.DetailService;

public class DetailServiceImpl implements DetailService
{

	@Override
	public List<Detail> getDetailListByorderNumber(List<Orders> ordersList)
	{
		List<Detail> detailList = new ArrayList();
		List<Detail> detailList1 = new ArrayList();
		DetailDao detailDao = new DetailDaoImpl();
		for(int i = 0; i < ordersList.size(); i++) {
			//找到每一个订单号所对应的detailList1
			detailList1 = detailDao.getDetailListByorderNumber(ordersList.get(i).getOrdersNumber());
			for(int j = 0; j < detailList1.size(); j++) {
				//遍历该订单号中所有的条目，存入detailList
				detailList.add(detailList1.get(j));
			}

		}
		
		
		return detailList;
	}

}
